package com.luke.exercise.generic;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;

/**
 * Created by lusen on 2017/2/6.
 */
class A<T, ID> {

}
class B extends A<String, Integer> {

}
public class Generic {
    public static void main(String[] args) {
        System.out.println(B.class.getGenericSuperclass());
        ParameterizedType parameterizedType = (ParameterizedType) A.class.getGenericSuperclass();
        Type[] types = parameterizedType.getActualTypeArguments();
        for (Type type : types) {
            System.out.println(type);
        }

    }
}
